<template>
  <div>
  <x-header title="我的返利" :right-options="{showMore: false}" @on-click-more="show = true"></x-header> 
    <ticket-page :backMoney="backMoney"></ticket-page>
   
  </div>
</template>

<style>

</style>

<script>
import { XHeader, Flexbox, Toast,FlexboxItem, Divider } from 'vux';
import ticketPage from "../../components/toolComponent/ticketPage"
import { homeUrl } from "../../components/utils/utils.js";
import axios from "axios";
import qs from "qs";
export default {
  components: {
    XHeader,
    Flexbox,
    FlexboxItem,
    Divider,
    Toast,
    ticketPage
  },
  data(){
    return{
      messShow:false,
      message:"",
      backMoney:[],
     wxOpenId:localStorage.getItem("openid"),
    }
  },
  methods:{
    requestBackMoney(){
      var datas = qs.stringify({
        wxid:this.wxOpenId,
      });
      axios
        .post(homeUrl() + "rebateTableQuery/", datas, { emulateJSON: true })
        .then(
          result => {
            console.log(result);
           if(result.data.status=="ok"){
             this.backMoney=result.data.data;
           }
          },
          error => {
            this.$vux.toast.text("网络请求失败....", "bottom");
            console.log(error);
          }
        );
    },
  },
  created(){
    this.requestBackMoney()
  },
  updated: function() {
    // this.requestFavouriteData()
    // console.log("更新完成");
  },
}
</script>